<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="mobile-web-app-capable" content="yes">
	<meta name="msapplication-tap-highlight" content="no">   	  
	<link rel="stylesheet" href="<%=commonPath %>/pageRc/layui/css/layui.css" media="all">
 	<script type="text/javascript" src="<%=commonPath %>/pageRc/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/common/utils.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/common/msgTool.js"></script>
	<link rel="stylesheet" href="<%=commonPath %>/pageRc/layui/css/layui.css" media="all">
	<script type="text/javascript" src="<%=commonPath %>/pageRc/js/jquery-1.9.1.min.js"></script>
	<link rel="stylesheet" href="<%=commonPath %>/pageRc/plugs/ebankLayer/css/ebankLayer.css">
	<link href="<%=commonPath %>/pageRc/css/paygate/bcslayer.css" rel="stylesheet" type="text/css"/>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/plugs/ebankLayer/js/ebankLayer.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/common/utils.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/common/msgTool.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/layui/layui.js"></script>
 	
	
	<title>联信科技软件部服务平台后台管理</title>
	<style type="text/css">
		.ocx_style {
			border: 1px solid #ECECEC;
			width: 155px;
			height: 24px;
			line-height:25px;
			width: 250px
		}
	</style>
	<script type="text/javascript">
	var path = "<%=commonPath%>";
	var msg =new msgTool();  
	/**退出**/ 
	function logout(){
		location.href ="<%=commonPath%>/page/main/manager.do?state=logout";
	}
	
	
	layui.use(
			[ 'form', 'layer', 'laytpl', 'laypage','laydate' ],
			function() {
				var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
		        var form = layui.form()
		            ,layer = layui.layer
		            ,laypage = layui.laypage
		            ,laytpl = layui.laytpl;
		        var active = {
		        		close:function(){ 
		        			alert("ddd");
		        		}}
			}) 
	function close(){
		alert(1);
	}
	
	function updPass(){
		//cms.clickLI(8);
	        layer.open({
	            type: 2,
	            title:"修改密码",
	            area: ['35%', '60%'],
	            scrollbar: false,
	            content: path+'/page/main/updPassWord.do',
	            success: function (layero, index) {
	            }
	           
	        });
	}

	</script>
</head>
<body> 
<input type="hidden" id="position_type" value="${position_type}">
  <!-- 布局容器 -->
    <div class="layui-layout layui-layout-admin">
        <!-- 头部 -->
        <div class="layui-header">
            <div class="layui-main">
                <!-- logo -->
                <a href="#" style="color: #ffffff; font-size: 18px; line-height: 60px;">联信科技后台管理</a>
                <!-- 水平导航 -->
                <ul class="layui-nav" style=" position: absolute; top: 0; right: 0; background: none;">
                    <li class="layui-nav-item" style="float: left;">
                        <a href="#" style="color: #ffffff; font-size: 15px;"><span id="userTeamName"></span>-<span id="userName"></span><span id="positionType"></span></a>
                    </li>
                    <li class="layui-nav-item" style="float: left;">
                        <a href="javascript:;">
                            
                        </a>
                        <dl class="layui-nav-child">
                          <!--  <dd>
                                <a href="javascript:;">
                                    个人信息
                                </a>
                            </dd>-->
                            <dd>
                                <a href="javascript:updPass();">
                                    修改密码
                                </a>
                            </dd>  
                            <dd>
                                <a href="javascript:logout();">
                                    退出登录
                                </a>
                            </dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 侧边栏 -->
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree"  lay-filter="left-nav" style="border-radius: 0;color:#666666 ">
                <c:forEach items="${funcList}" var="func" >
                 <li class="layui-nav-item layui-nav-itemed"> 
                    <a href="<%=commonPath %>/${func.funcUrl}">
				       <i class="layui-icon">${func.funcIcon}</i> ${func.funcNa}
				     </a>
                 </li>  
     			</c:forEach>  
                </ul>
            </div>
        </div>

        <!-- 主体 -->
        <div class="layui-body">
            <!-- 顶部切换卡 -->
            <div class="layui-tab layui-tab-brief" lay-filter="top-tab" lay-allowClose="true" style="margin: 0;">
                <ul class="layui-tab-title"></ul>
                <div class="layui-tab-content">  </div>
            </div>
        </div> 
    </div> 
    <script type="text/javascript"> 
        /**
         * 对layui进行全局配置
         */
        layui.config({
            base: 'js/'
        });
 
        var cms;
          /**
         * 初始化整个cms骨架
         */
        layui.use(['cms'], function() {
        	msg.sendMsg("/page/sys/getUserFuncList.do",
					{},
						function(data) {
 		        		  var funcList = data.body.funcList;
 		        		  var user = data.body.user;
 		        		  $("#userTeamName").html(user.proTeamName);
 		        		  $("#userName").html(user.userName);
 		        		  if(user.position_type == "69"){
 		        			 $("#positionType").html("（团队经理）");
 		        		  }else if(user.position_type == "70"){
 		        			 $("#positionType").html("（项目经理）");
 		        		  }else if(user.position_type == "68" || user.position_type == "101" || user.position_type == "103" || user.position_type == "109"){
 		        			 $("#positionType").html("（部门总监）");
 		        		  }else if(user.position_type == "1"){
 		        			 $("#positionType").html("（admin）");
 		        		  }
		        		  var datas=[];
		        		  for(var i = 0 ;i<funcList.length;i++){
		        			  if(funcList[i].funcId == '10305' || funcList[i].funcId == '10400' || funcList[i].funcId == '10522'){
		        				  datas[i]={id:9,pid:funcList[i].funcPaId,node:funcList[i].funcNa,url:'<%=commonPath %>/'+funcList[i].funcUrl+'?rouid=${loginUser.rouid}'}
		        			  }else{
		        				  datas[i]={id:funcList[i].funcId,pid:funcList[i].funcPaId,node:funcList[i].funcNa,url:'<%=commonPath %>/'+funcList[i].funcUrl+'?rouid=${loginUser.rouid}'}
		        			  }
		        		  }
 				          cms = layui.cms('left-nav', 'top-tab');
				          cms.addNav(datas, 1, 'id', 'pid', 'node', 'url');
				          cms.bind(60 + 41 +80); //头部高度 + 顶部切换卡标题高度 + 顶部切换卡内容padding + 底部高度
				          if(user.position_type == "69"){
				        	  cms.clickLI(2);
				          }else if(user.position_type == "70"){
				        	  cms.clickLI(1);
				          }
				          else if(user.position_type == "109"){
				        	  cms.clickLI(3);
				          }
				          else if(user.position_type == "87"){
				        	  cms.clickLI(4);
				          }else{
				        	  
				          }
					});
          		
       });
    	
    </script>
</body>
</html>